﻿using DevExpress.XtraEditors;
using DXApplicationTangche.UC.圣同润.merchant;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 广州爱特安为科技.UC.圣同润.客服.售后
{
    public partial class Form售后二次审核一览 : DevExpress.XtraEditors.XtraForm
    {
        private List<RefundAuditDataDao> refundAuditDataDaos;
        public Form售后二次审核一览()
        {
            InitializeComponent();
            this.refundAuditDataDaos = MerchantService.getRefundAuditList();
            this.gridControl售后二次审核.DataSource = this.refundAuditDataDaos;
            this.gridView售后二次审核.RefreshData();
        }

        private void 二次审核详情ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                String order_sn = this.gridView售后二次审核.GetRowCellValue(this.gridView售后二次审核.FocusedRowHandle, "orderId").ToString();
                foreach (RefundAuditDataDao item in this.refundAuditDataDaos)
                {
                    if (order_sn.Equals(item.orderId))
                    {

                        new Form售后二次审核详情(item).ShowDialog();
                        break;
                    }
                }
            }
            catch { }
        }

        private void simpleButton导出Excel_Click(object sender, EventArgs e)
        {
            if (this.gridView售后二次审核.DataRowCount <= 0)
            {
                return;
            }
            SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Title = "导出Excel";
            fileDialog.Filter = "Excel文件(*.xls)|*.xls";
            DialogResult dialogResult = fileDialog.ShowDialog(this);
            if (dialogResult == DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                this.gridView售后二次审核.ExportToXls(fileDialog.FileName);
                DevExpress.XtraEditors.XtraMessageBox.Show("保存成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}